<template>
  <div class="module2">
    module2
    <el-button @click="test">test</el-button>
    <el-button @click="loading1" type="primary"  icon="el-icon-user-solid" :loading="loading">loading</el-button>
  </div>
</template>

<script>

import {emitEvent} from "@/js/EventBus.js";

export default {
  name: "module2",
  data() {
    return {
      loading: false
    }
  },
  methods: {
    loading1() {
      this.loading = true
      setTimeout(() => {
        this.loading = false
      }, 3000)
    },
    test() {
      this.$api.main.test()
          .then((res) => {
            console.log(res.data)
          })
          .catch((err) => {
            console.log(err)
          })
    }
  },
}
</script>

<style scoped lang="less">
.module2 {

}
</style>
